<?php
class SoapFactory
{
	public static function create($wsdl, $opts = array())
	{
		ini_set('soap.wsdl_cache_enabled', '0');
		if( !$wsdl ) throw new Exception('wsdl url empty');
		
		$defaultOpts = array(
			'trace' => 1,
			'soap_version' => SOAP_1_1,
			'style' => SOAP_RPC,
			'encoding' => SOAP_LITERAL
		);
		
		$newOpts = array_merge($defaultOpts, $opts);
		
		$soapClient = new SoapClient($wsdl, $opts);
		return $soapClient;
	}
}
?>